home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
scope
/
001-025
/
scopedisk19
/
blinker
/
linkmodules.sub
< prev
next >
Wrap
Text File
|
1995-03-18
|
1KB
|
61 lines
'---------------------------------------------------------------------------
'
' Link Modules
'
'
' Copyright 1987 by Brian Zupke
'
' Builds list containing names of modules needed for
' a complete build. If all modules are found, then BuildComplete
' is flagged TRUE.
SUB LinkModules.SUB(ProgramName$,ModulesUsed$(1),Used,BuildComplete) STATIC
'
'
' Allow up to 40 different Subprogram names called.
'
DIM ModulesCalled$(40)
'
' Initialize
'
BuildComplete = FALSE
Used = 1
Scanned = 0
ModulesUsed$(Used) = ProgramName$
RepeatUntil = TRUE
'
' Build List
'
WHILE RepeatUntil
'
' Get name of next module to be scanned.
'
ModuleName$ = ModulesUsed$(Scanned + 1)
CALL ScanModule.SUB(ModuleName$,ModulesCalled$(),Called,ModuleScanned)
'
' Compare any calls found with modules used list
'
IF Called > 0 THEN
FOR x = 1 TO Called
IsNotIn = TRUE
FOR y = 1 TO Used
IF UCASE$(ModulesCalled$(x)) = UCASE$(ModulesUsed$(y)) THEN IsNotIn = FALSE
NEXT y
'
' Add name to list if it is not used
'
IF IsNotIn THEN
Used = Used + 1
ModulesUsed$(Used) = ModulesCalled$(x)
END IF
NEXT x
END IF
Scanned = Scanned + 1
IF (Used = Scanned) OR (NOT ModuleScanned) THEN RepeatUntil = FALSE
WEND
'
' Build is complete if last module scanned successfully
'
BuildComplete = ModuleScanned
END SUB